class A:
    def __init__(self,value=None):
        self.val = value

    def __get__(self, obj,value):
        return self.val - 20

    def __set__(self, obj,value):
        self.val = value + 1000
        print(self.val)

class B:
    x = A()

if __name__ == '__main__':
    b = B()
    b.x = 10
    print(b.x)

